<?php defined('IN_IA') or exit('Access Denied');?><?php (!empty($this) && $this instanceof WeModuleSite || 1) ? (include $this->template('public/header', TEMPLATE_INCLUDEPATH)) : (include template('public/header', TEMPLATE_INCLUDEPATH));?>

<?php (!empty($this) && $this instanceof WeModuleSite || 1) ? (include $this->template('public/comhead', TEMPLATE_INCLUDEPATH)) : (include template('public/comhead', TEMPLATE_INCLUDEPATH));?>

<link rel="stylesheet" type="text/css" href="../addons/yzzc_sun/template/public/ygcss.css">

<ul class="nav nav-tabs">
    <span class="ygxian"></span>
    <div class="ygdangq">当前位置:</div>
    <li class="active"><a href="javascript:void(0);">会员特权列表</a></li>
</ul>
<div class="main ygmain">

    <div class="panel panel-default ygdefault">

        <div class="panel-heading wyheader">
            <a href="<?php  echo $this->createWebUrl('member')?>" class="storespan2 btn btn-xs" style="left: 15px;background-color: #444444;color: #fff;border-color: #444444;">
                <span class="fa fa-plus"></span>添加会员等级
                <span class="bianji" style="left: 15px;background-color: #444444;color: #fff;border-color: #444444;">添加会员等级
                        <span class="arrowdown"></span>
                    </span>
            </a>
            <a href="<?php  echo $this->createWebUrl('memberrule')?>" class="storespan2 btn btn-xs" style="left: 15px;background-color: #444444;color: #fff;border-color: #444444;">
                <span class="fa fa-plus"></span>添加会员使用规则
                <span class="bianji" style="left: 15px;background-color: #444444;color: #fff;border-color: #444444;">添加会员使用规则
                        <span class="arrowdown"></span>
                    </span>
            </a>
        </div>

        <div class="panel panel-default">
            <div class="panel-heading">
                会员特权列表
            </div>
            <div class="panel-body" style="padding: 0px 15px;">
                <div class="row">
                    <table class="yg5_tabel col-md-12">
                        <tr class="yg5_tr1">
                    <tr class="yg5_tr1" style="border-bottom: 1px solid #efefef;font-weight: bold;text-align: center;">
                        <td style="text-align: center;">编号 </td>
                        <td style="text-align: center;width: 200px;">会员等级名称</td>
                        <td style="text-align: center;">等级所需积分 </td>
                        <td style="text-align: center;">会员特权 </td>
                        <td>操作</td>
                    </tr>
                    <?php  if(is_array($info)) { foreach($info as $key => $item) { ?>
                    <tbody>
                    <tr class="yg5_tr2" style="border-bottom: 1px solid #efefef;font-weight: bold;text-align: center;">

                        <td><?php  echo $item['id'];?></td>
                        <td><?php  echo $item['level_name'];?></td>
                        <td><?php  echo $item['level_score'];?></td>
                        <?php  if($item['level_privileges']==1) { ?>
                        <td>
                            <span class="label storegrey">无特权</span>
                        </td >
                        <?php  } else if($item['level_privileges']==2) { ?>
                        <td >
                            <span class="label storeblue">免收基础服务费</span>
                        </td>
                        <?php  } else if($item['level_privileges']==3) { ?>
                        <td>
                            <span class="label storered">延迟<?php  echo $item['delay'];?>小时还车</span>
                        </td>
                        <?php  } ?>

                        <td>

                            <a href="<?php  echo $this->createWebUrl('member', array('id' => $item['id']))?>" class="storespan btn btn-xs">
                                <span class="fa fa-pencil"></span>
                                <span class="bianji">编辑
                                    <span class="arrowdown"></span>
                                 </span>
                            </a>

                            <a class="storespan btn btn-xs" onclick="delcounp(<?php  echo $item['id'];?>)" >
                                <span class="fa fa-trash-o"></span>
                                <span class="bianji">删除
                                    <span class="arrowdown"></span>
                                </span>
                            </a>
                        </td>
                        <!--<td>-->
                        <!--<a class="fxiala" data-toggle="collapse" data-parent="#accordion" href="#collapse<?php  echo $row['id'];?>">-->
                        <!--<span class="fa fa-chevron-down"></span>-->
                        <!--</a>-->
                        <!--</td>-->
                    </tr>
                    </tbody>
                    <?php  } } ?>
                    <?php  if(empty($item)) { ?>
                    <tr class="yg5_tr2">
                        <td colspan="8">
                            暂无会员信息
                        </td>
                    </tr>
                    <?php  } ?>
                </table>
            </div>
        </div>

    </div>
    </form>
</div>
<script type="text/javascript">
    $(function(){
        $("#frame-11").show();
        $("#yframe-11").addClass("wyactive");
    })
    function delcounp(id) {
        var ret = confirm("您确定删除吗？")
        if (ret==true){
            $.ajax({
                type:"POST",
                url:"<?php   echo $this->createWebUrl('memberslist',array('op'=>delete))?>",
                dataType:"JSON",
                data:{id:id},
                success:function(res){
                    console.log(res);
                    location.reload();

                }
            })
        }
    }
</script>